package com.muyu.payment.service;

import com.muyu.payment.domain.WithdrawOrder;
import com.muyu.payment.domain.req.WithdrawReq;

/**
 * 提现服务接口
 *
 * @author muyu
 * @date 2025-01-27
 */
public interface WithdrawService {

    /**
     * 创建提现订单
     *
     * @param userId 用户ID
     * @param userName 用户账号
     * @param request 提现请求
     * @return 提现订单
     */
    WithdrawOrder createWithdrawOrder(Long userId, String userName, WithdrawReq request);

    /**
     * 审核提现订单
     *
     * @param orderNo 订单号
     * @param auditResult 审核结果（1:通过 2:拒绝）
     * @param auditor 审核人
     * @param auditRemark 审核备注
     * @return 是否成功
     */
    boolean auditWithdrawOrder(String orderNo, Integer auditResult, String auditor, String auditRemark);

    /**
     * 处理提现订单
     *
     * @param orderNo 订单号
     * @param status 处理状态（3:成功 4:失败）
     * @param thirdPartyTradeNo 第三方交易号
     * @param failReason 失败原因
     * @return 是否成功
     */
    boolean processWithdrawOrder(String orderNo, Integer status, String thirdPartyTradeNo, String failReason);

    /**
     * 根据订单号查询提现订单
     *
     * @param orderNo 订单号
     * @return 提现订单
     */
    WithdrawOrder getWithdrawOrderByOrderNo(String orderNo);

    /**
     * 取消提现订单
     *
     * @param orderNo 订单号
     * @return 是否成功
     */
    boolean cancelWithdrawOrder(String orderNo);
}